<tagLib name="strends" />
<include file="Public:header" />
<table cellpadding="4" cellspacing="0" border="0" class="table-form">
	<tr>
		<td>
			<ul class="tipslis">
				<li>{%SYSTEM_TIPS1}</li>
			</ul>
		</td>
	</tr>
	<tr>
		<td style="padding-left:30px;">
			<label for="all_cache" ><input type="radio" id="all_cache" name="select_type" value="1" checked />&nbsp;<span>{%ALL_CACHE}</span></label>&nbsp;&nbsp;
			<label for="specified" ><input type="radio" id="specified" name="select_type" value="0" />&nbsp;<span>{%SPECIFIED}</span></label>&nbsp;&nbsp;
		</td>
	</tr>
	<tr id="select_net" >
		<td style="padding-left:30px;">
			指定 域名：
			<select name="domain" id="domain">
				<option value="http://www.stylehouse.com.cn">房产网</option>
				<option value="http://www.styleauto.com.cn">汽车网</option>
				<option value="http://www.trendstyle3d.com">时尚网(tre)</option>
				<option value="http://www.3dtrendstyle.com">时尚网(3D)</option>
				<option value="http://www.stylemode.com">时尚网(新)</option>
			</select>
		</td>
	</tr>	
	<tr id="all_cache_url" >
		<td style="padding-left:30px;">
			{%HOME_ALL}:<label for="home" ><input type="checkbox" id="home" name="home" value="1" />&nbsp;<span>{%ALL}</span></label>&nbsp;&nbsp;
			<label for="is_home" ><input type="checkbox" id="is_home" name="is_home" value="1" />&nbsp;<span>{%PAGE_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_home_js" ><input type="checkbox" id="is_home_js" name="is_home_js" value="1" />&nbsp;<span>{%JS_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_home_img" ><input type="checkbox" id="is_home_img" name="is_home_img" value="1" />&nbsp;<span>{%IMG_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_home_css" ><input type="checkbox" id="is_home_css" name="is_home_css" value="1" />&nbsp;<span>{%CSS_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_home_xml" ><input type="checkbox" id="is_home_xml" name="is_home_xml" value="1" />&nbsp;<span>{%XML_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_home_flash" ><input type="checkbox" id="is_home_flash" name="is_home_flash" value="1" />&nbsp;<span>{%FLASH_CACHE}</span></label><br /><br />
			{%AUTO_ALL}:<label for="auto" ><input type="checkbox" id="auto" name="auto" value="1" />&nbsp;<span>{%ALL}</span></label>&nbsp;&nbsp;
			<label for="is_auto" ><input type="checkbox" id="is_auto" name="is_auto" value="1" />&nbsp;<span>{%PAGE_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_auto_js" ><input type="checkbox" id="is_auto_js" name="is_auto_js" value="1" />&nbsp;<span>{%JS_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_auto_img" ><input type="checkbox" id="is_auto_img" name="is_auto_img" value="1" />&nbsp;<span>{%IMG_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_auto_css" ><input type="checkbox" id="is_auto_css" name="is_auto_css" value="1" />&nbsp;<span>{%CSS_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_auto_xml" ><input type="checkbox" id="is_auto_xml" name="is_auto_xml" value="1" />&nbsp;<span>{%XML_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_auto_flash" ><input type="checkbox" id="is_auto_flash" name="is_auto_flash" value="1" />&nbsp;<span>{%FLASH_CACHE}</span></label>&nbsp;&nbsp;
			<br /><br />
			{%FASHION_ALL}:<label for="fashion" ><input type="checkbox" id="fashion" name="fashion" value="1" />&nbsp;<span>{%ALL}</span></label>&nbsp;&nbsp;
			<label for="is_fashion" ><input type="checkbox" id="is_fashion" name="is_fashion" value="1" />&nbsp;<span>{%PAGE_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_fashion_js" ><input type="checkbox" id="is_fashion_js" name="is_fashion_js" value="1" />&nbsp;<span>{%JS_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_fashion_img" ><input type="checkbox" id="is_fashion_img" name="is_fashion_img" value="1" />&nbsp;<span>{%IMG_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_fashion_css" ><input type="checkbox" id="is_fashion_css" name="is_fashion_css" value="1" />&nbsp;<span>{%CSS_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_fashion_xml" ><input type="checkbox" id="is_fashion_xml" name="is_fashion_xml" value="1" />&nbsp;<span>{%XML_CACHE}</span></label>&nbsp;&nbsp;
			<label for="is_fashion_flash" ><input type="checkbox" id="is_fashion_flash" name="is_fashion_flash" value="1" />&nbsp;<span>{%FLASH_CACHE}</span></label>&nbsp;&nbsp;
			
			<br /><br />
		</td>
	</tr>
	<tr  id="specified_url">
		<td style="padding-left:30px;">
			指定 url：<input name="clean_url" id="clean_url" value="" size="36" />
		</td>
	</tr>
	<tr>
		<td style="padding-left:30px;">
			<input id="submit" type="submit" class="submit_btn" value="{%SUBMIT}" />
		</td>
	</tr>
	
</table>
<script>
	$(function (){
		function  vals(obj,type){
			if(type=="id"){
				return $("#"+obj).attr("value");
			}else if(type=="class"){
				return $("."+obj).attr("value");
			}
		}
		$("#specified_url").css("display","none");
		$("#select_net").css("display","none");
		$("#submit").click(function (){
			var clean_url=vals("clean_url","id");
			var domain=vals("domain","id");
			var all_cache=vals("all_cache","id");
			var specified=vals("specified","id");
			var home=vals("home","id");
			var auto=vals("auto","id");
			var fashion=vals("fashion","id");

			if(all_cache==1){
				var url="select=1";
				if(home=="2"){
					url+="&home=2";
				}else{
					var home_not="#home,#auto,#fashion,#is_auto,#is_auto_js,#is_auto_img,#is_auto_css,#is_auto_xml,#is_auto_flash,#is_fashion,#is_fashion_js,#is_fashion_img,#is_fashion_css,#is_fashion_xml,#is_fashion_flash";
					$(":checkbox").not($(home_not)).each(function (obj){
						var checkbox_val=$(this).attr('value');
						var checkbox_name=$(this).attr('name');
						if(checkbox_val==2){
							url+="&"+checkbox_name+"="+checkbox_val;
						}
					});
				}
				if(auto=="2"){
					url+="&auto=2";
				}else{
					var auto_not="#home,#auto,#is_home,#is_home_js,#is_home_img,#is_home_css,#is_home_xml,#is_home_flash,#fashion,#is_fashion,#is_fashion_js,#is_fashion_img,#is_fashion_css,#is_fashion_xml,#is_fashion_flash";
					$(":checkbox").not($(auto_not)).each(function (obj){
						var checkbox_val=$(this).attr('value');
						var checkbox_name=$(this).attr('name');
						if(checkbox_val==2){
							url+="&"+checkbox_name+"="+checkbox_val;
						}
					});
				}
				if(fashion=="2"){
					url+="&fashion=2";
				}else{
					var fashion_not="#home,#auto,#is_home,#is_home_js,#is_home_img,#is_home_css,#is_home_xml,#is_home_flash,#is_auto,#is_auto_js,#is_auto_img,#is_auto_css,#is_auto_xml,#is_auto_flash";
					$(":checkbox").not($(fashion_not)).each(function (obj){
						var checkbox_val=$(this).attr('value');
						var checkbox_name=$(this).attr('name');
						if(checkbox_val==2){
							url+="&"+checkbox_name+"="+checkbox_val;
						}
					});
				}
				
				if(url=="select=1"){
					alert("请选择一个");
					return false;
				}
				
				$.ajax({
				   url: '/trends/index.php?m=CleanVarnish&a=SelectUp',
				   type:"POST",
				   dataType:"json",
				   data:url,
				   async:false,
				   success: function (result){
						//alert(result.res);
						if(result.msg=="clear"){
							alert("缓存清除成功");
						}else{
							alert("缓存清除失败");
						}
				   }
				});
			}
			if(specified=="1"){
				if(clean_url==""){
					alert("clean_url:不能为空");
				}else{
					var pre="clean_url='"+clean_url+"'&domain='"+domain+"'";
					$.ajax({
					   url: '/trends/index.php?m=CleanVarnish&a=CleanUp',
					   type:"POST",
					   dataType:"json",
					   data:pre,
					   async:false,
					   success: function (result){
							//alert(result.res);
							if(result.msg=="clear"){
								alert("缓存清除成功");
							}else{
								alert("缓存清除失败");
							}
					   }
					});
				}
			}
		});
		
		$('#all_cache').live("click",function (){
			$('#all_cache_url').css('display','block');
			$('#specified_url').css('display','none');
			$('#select_net').css('display','none');
			$(this).attr('value','1');
			$('#specified').attr('value','0');
		});
		
		$('#specified').live("click",function (){
			$('#specified_url').css('display','block');
			$('#all_cache_url').css('display','none');
			$('#select_net').css('display','block');
			$(this).attr('value','1');
			$('#all_cache').attr('value','0');
		});
		
		$('#home').click(function (){
			var is_ready=$("#is_home").attr("disabled");
			if(!is_ready){
				$("#is_home,#is_home_js,#is_home_img,#is_home_css,#is_home_xml,#is_home_flash").attr("disabled",'disabled');
				$("#is_home,#is_home_js,#is_home_img,#is_home_css,#is_home_xml,#is_home_flash").attr("value",'1');
				$("#is_home,#is_home_js,#is_home_img,#is_home_css,#is_home_xml,#is_home_flash").attr("checked",false);
				$(this).attr('value','2');
			}else{
				$("#is_home,#is_home_js,#is_home_img,#is_home_css,#is_home_xml,#is_home_flash").removeAttr("disabled");
				$(this).attr('value','1');
			}
		});

		$('#auto').click(function (){
			var is_ready=$("#is_auto").attr("disabled");
			if(!is_ready){
				$("#is_auto,#is_auto_js,#is_auto_img,#is_auto_css,#is_auto_xml,#is_auto_flash").attr("disabled",'disabled');
				$("#is_auto,#is_auto_js,#is_auto_img,#is_auto_css,#is_auto_xml,#is_auto_flash").attr("value",'1');
				$("#is_auto,#is_auto_js,#is_auto_img,#is_auto_css,#is_auto_xml,#is_auto_flash").attr("checked",false);
				$(this).attr('value','2');
			}else{
				$("#is_auto,#is_auto_js,#is_auto_img,#is_auto_css,#is_auto_xml,#is_auto_flash").removeAttr("disabled");
				$(this).attr('value','1');
			}
		});
		$('#fashion').click(function (){
			var is_ready=$("#is_fashion").attr("disabled");
			if(!is_ready){
				$("#is_fashion,#is_fashion_js,#is_fashion_img,#is_fashion_css,#is_fashion_xml,#is_fashion_flash").attr("disabled",'disabled');
				$("#is_fashion,#is_fashion_js,#is_fashion_img,#is_fashion_css,#is_fashion_xml,#is_fashion_flash").attr("value",'1');
				$("#is_fashion,#is_fashion_js,#is_fashion_img,#is_fashion_css,#is_fashion_xml,#is_fashion_flash").attr("checked",false);
				$(this).attr('value','2');
			}else{
				$("#is_fashion,#is_fashion_js,#is_fashion_img,#is_fashion_css,#is_fashion_xml,#is_fashion_flash").removeAttr("disabled");
				$(this).attr('value','1');
			}
		});
		
		$("#is_home,#is_home_js,#is_home_img,#is_home_css,#is_home_xml,#is_home_flash,#is_auto,#is_auto_js,#is_auto_img,#is_auto_css,#is_auto_xml,#is_auto_flash,#is_fashion,#is_fashion_js,#is_fashion_img,#is_fashion_css,#is_fashion_xml,#is_fashion_flash").click(function (){
			var val=$(this).attr('value');
			if(val=="1"){
				val=$(this).attr('value','2');
			}else{
				val=$(this).attr('value','1');
			}
		});
		
	});
</script>
<include file="Public:footer" />